<template>
  <div>
    <div v-for="item in currentMenus" :key="item.path">
      <el-submenu :index="item.path" v-if="item.children">
        <template slot="title">{{ item.title }}</template>
        <custom-submenu :current-menus="item.children"></custom-submenu>
      </el-submenu>
      <!--   如果只有一层   -->
      <el-menu-item :index="item.path" v-if="!item.children">
        <i class="el-icon-menu"></i>
        <span slot="title">{{ item.title }}</span>
      </el-menu-item>
    </div>
  </div>

</template>

<script>
export default {
  name: "custom-submenu",
  props: ['currentMenus']
}
</script>

<style scoped>

</style>
